Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aio): each doc can add/remove class to aio-shell with <aio-context> #16564

Closed
wants to merge 1 commit into from

Conversation

wardbell
Copy link
Contributor

@wardbell wardbell commented May 5, 2017

closes #16549
Supports doc-specific styling of the entire shell based on the context of the current document.
Also adds the “marketing” class if the docId indicates the doc is neither a guide nor tutorial page.

Add something like the following near the top (or at the top) of the .md (or .html) file.

<aio-context class="foo bar"></aio-context>

If it’s a guide or tutorial page ('guide/...' or 'tutorial/...'), this PR's changes will copy the classes up and you’ll see <aio-shell class="foo bar">. Otherwise you'll see <aio-shell class="marketing foo bar">.


Please check if the PR fulfills these requirements

@wardbell wardbell added comp: aio action: review The PR is still awaiting reviews from at least one requested reviewer labels May 5, 2017
@wardbell wardbell self-assigned this May 5, 2017
@wardbell wardbell requested a review from sjtrimble May 5, 2017 03:14
@wardbell wardbell added this to REVIEW in docs-infra May 5, 2017
@mary-poppins
Copy link

The angular.io preview for e99379c is available here.

closes angular#16549
Supports doc-specific styling of the entire shell based on the context of the current document.
Also adds the “marketing” class if the docId indicates the doc is neither a guide nor tutorial page.
@mary-poppins
Copy link

The angular.io preview for 1cfcabb is available here.

Copy link
Contributor

@sjtrimble sjtrimble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be great!

Copy link
Member

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fear that this kind of change will be a pain to maintain and will be even more of an issue if we wanted to make the project reusable.

We are hard coding data, like guide and tutorial into the AppComponent, hidden inside application code.

Also we are adding a new undocumented feature of an <aio-context> tag, which is also hidden inside the application code. While it seems simple to do it this way, it doesn't fit with the general architecture of the app. If anything I would have expected it to be an embeddedComponent, similar to what we used to have to set the title from the content.

Could we not extend the feature that sets the pageId and assign that value to a class on the <aio-shell> tag? This would keep the application clean of hardcoded values; it would just put the burden of the styling on the CSS to capture all these classes because they would be different for each page.

petebacondarwin added a commit to petebacondarwin/angular that referenced this pull request May 5, 2017
petebacondarwin added a commit to petebacondarwin/angular that referenced this pull request May 5, 2017
petebacondarwin added a commit to petebacondarwin/angular that referenced this pull request May 5, 2017
matsko pushed a commit that referenced this pull request May 5, 2017
@petebacondarwin
Copy link
Member

Closing for now.

@petebacondarwin petebacondarwin removed this from REVIEW in docs-infra May 6, 2017
asnowwolf pushed a commit to asnowwolf/angular that referenced this pull request Aug 11, 2017
juleskremer pushed a commit to juleskremer/angular that referenced this pull request Aug 28, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: review The PR is still awaiting reviews from at least one requested reviewer cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aio: any doc can add/remove class/attr to/from aio-shell
5 participants